import request from '@/utils/request'

// 获取验证码
export function sendCodeApi(data) {
    return request({
        method: 'post',
        url: '/user/sendCode',
        data:data
    })
}

// 登录
export function loginApi(data) {
    return request({
        method: 'post',
        url: '/user/login',
        data:data
    })
}

// 退出登录
export function logoutApi() {
    return request({
        method: 'post',
        url: '/user/logout'
    })
}

// 得到用户信息
export function infoApi() {
    return request({
        method: "get",
        url:'/user/info'
    })
}


// 点击报名竞赛
export function registerExamApi(data) {
    
    return request({
        method: 'post',
        url: '/user/exam/signUp',
        data:data
    })
}


// 获取我的竞赛列表
export function getMyExamListApi(params) {
    return request({
        method: 'get',
        url: '/user/exam/list',
        params
    })
}


// 获取用户信息
export function getUserDetailApi() {
    return request({
        method: 'get',
        url:'/user/detail'
    })
}

// 编辑用户
export function editUserInfoApi(data) {
    return request({
        method: 'put',
        url: "/user/edit",
        data:data
    })
}


// 编辑头像
export function updateHeadImageApi(data) {
    return request({
        method: 'put',
        url: "user/headImage/update",
        data:data
    })
}


// 用户提交代码
export function userSubmitCodeApi(data) {
    return request({
        method: 'post',
        url: 'user/question/mq/submit',
        data:data
    })
}

// 获取消息列表
export function getMessageListApi(params) {
    return request({
        method: 'get',
        url: '/user/message/list',
        params
    })
}

// 删除消息
export function delMessageApi(textId) {
    return request({
        method: 'delete',
        url: '/user/message/del',
        params:{textId}
    })
}